<template>
  <div class="userbusiness">
    <el-form :inline="true" class="demo-form-inline">
      <el-form-item label="征地项目:">
        <el-select
          v-model="value"
          value-key="Id"
          placeholder="请选择"
          @change="overChange()"
        >
          <el-option
            v-for="item in options"
            :key="item.Id"
            :label="
              item.township + 
              '--' +
              item.Village +
              '--' +
              item.YearNum +
              '--' +
              item.ProjectName +
              '--' +
              item.ReviewFarmer +
              ' / ' +
              item.farmerAccount
            "
            :value="item.Id"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="" @click="onSubmit" class="el-icon-search"
          >查询</el-button
        >
        <!-- <el-button type="" class="el-icon-download" @click="exportClick()"
          >导出为文档</el-button
        > -->
        <!-- <el-button type="" @click="submitId">{{
          openchange ? "项目详情" : "展开"
        }}</el-button> -->

        <el-button @click="submitId" v-if="openchange" class="el-icon-caret-top"
          >项目详情</el-button
        >
        <el-button @click="submitId" v-else class="el-icon-caret-bottom"
          >项目详情</el-button
        >
        <el-button type="" @click="reject">勾选退回</el-button>
        <el-button type="" @click="rejectAll">全部退回</el-button>
        <el-button type="" @click="adopt">勾选通过</el-button>
        <el-button type="" @click="adoptAll">全部通过</el-button>
      </el-form-item>
    </el-form>
    <!-- <el-form
      :inline="true"
      class="demo-form-inline second"
      :label-position="labelPosition"
      v-show="openchange"
      :model="ruleForm"
    >
      <el-form-item label="村:" label-width="101px"
        ><el-input
          v-model="ruleForm.village"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="用地项目名称:" label-width="101px"
        ><el-input
          v-model="ruleForm.landName"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="年度:" label-width="101px"
        ><el-input
          v-model="ruleForm.years"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="批次:" label-width="101px"
        ><el-input
          v-model="ruleForm.pic"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="地块:" label-width="101px"
        ><el-input
          v-model="ruleForm.land"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="基准日期:" label-width="101px"
        ><el-input
          v-model="ruleForm.pDate"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="用地面积:" label-width="101px"
        ><el-input
          v-model="ruleForm.landMj"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="区片价:" label-width="101px"
        ><el-input
          v-model="ruleForm.price"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="征缴比例:" label-width="101px"
        ><el-input
          v-model="ruleForm.zjbli"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
      <el-form-item label="社会保险费:" label-width="101px"
        ><el-input
          v-model="ruleForm.shbxf"
          placeholder="展示内容"
          disabled
        ></el-input
      ></el-form-item>
    </el-form> -->

    <div class="xiang">
      <el-table
        :header-cell-style="{ 'text-align': 'center' }"
        :cell-style="{ 'text-align': 'center' }"
        v-show="openchange"
        :data="tableList"
        border
        style="width: 1991px"
        height="97"
      >
        <el-table-column prop="township" label="乡镇" width="180" />
        <el-table-column prop="Village" label="村" width="180" />
        <el-table-column prop="ProjectName" label="用地项目名称" width="220" />
        <el-table-column prop="YearNum" label="年度" width="130" />
        <el-table-column prop="BatchNum" label="批次" />
        <el-table-column prop="BlockNum" label="地块" />
        <el-table-column prop="ApprovedDate" label="基准日期" width="200">
          <template slot-scope="scope">{{
            formatDate(scope.row.ApprovedDate)
          }}</template>
        </el-table-column>
        <el-table-column
          prop="ApprovedArea"
          label="用地面积（亩）"
          width="130"
        />
        <el-table-column prop="RegionPrice" label="区片价" width="130" />
        <el-table-column prop="LevyScale" label="征缴比例" width="130" />
        <el-table-column prop="SecurityAmount" label="社会保险费" width="130" />
      </el-table>
    </div>

    <!-- 人员信息审核表 -->
    <el-table
      :header-cell-style="{ 'text-align': 'center' }"
      :cell-style="{ 'text-align': 'center' }"
      v-show="showInfo"
      :data="
        tableData.slice((currentPage - 1) * pagesize, currentPage * pagesize)
      "
      border
      style="margin-top: 30px"
      :summary-method="getSummaries"
      @selection-change="handleSelectionChange"
      height="calc(100vh - 460px)"
    >
      <el-table-column type="selection" width="55" fixed="left" />
      <el-table-column fixed="left" label="操作" width="150">
        <template slot-scope="scope">
          <div v-if="scope.row.ReviewResult === 1">
            <el-button type="text" size="small" @click="modify(scope.row)"
              >通过</el-button
            >
            <el-button type="text" size="small" @click="mitRef(scope.row)" style="color: #ff8888;"
              >退回</el-button
            >
          </div>
        </template>
      </el-table-column>
      <el-table-column type="index" label="序号" width="60"></el-table-column>
      <el-table-column prop="ReviewResult" label="状态" width="130">
        <template slot-scope="scope">
          <div v-if="scope.row.ReviewResult == 0">编辑</div>
          <div v-else-if="scope.row.ReviewResult == 1">待审核</div>
          <div v-else-if="scope.row.ReviewResult == 2">审核未通过</div>
          <div v-else>审核通过</div>
        </template>
      </el-table-column>
      <!-- <el-table-column prop="ProjectName" label="征地项目" width="180">
      </el-table-column>
      <el-table-column
        prop="ApprovedDate"
        :formatter="formDate"
        label="基准日期"
        width="180"
      >
      </el-table-column> -->
      <el-table-column prop="SocialSecurityType" label="参保类型" width="180">
        <template slot-scope="scope">
          <div v-if="scope.row.SocialSecurityType == '0'">其他</div>
          <div v-if="scope.row.SocialSecurityType == '1'">城居保</div>
          <div v-if="scope.row.SocialSecurityType == '2'">职保</div>
        </template>
      </el-table-column>
      <el-table-column prop="Name" label="姓名" width="100"> </el-table-column>
      <el-table-column prop="GenderCode" label="性别" width="80">
        <template slot-scope="scope">
          <div v-if="scope.row.GenderCode == '1'">男</div>
          <div v-else>女</div>
        </template>
      </el-table-column>
      <el-table-column prop="IdentityNum" label="身份证号" width="180">
      </el-table-column>
      <el-table-column
        prop="LandExpropriatedAge"
        label="被征地时年龄"
        width="160"
      >
      </el-table-column>
      <el-table-column
        prop="BasicSubsidyYears"
        label="基准补贴年限（年）"
        width="130"
        ><template slot-scope="scope">
          {{ yearjs(scope.row.BasicSubsidyYears) }}
        </template></el-table-column
      >
      <el-table-column
        prop="PovertySubsidyYears"
        label="享受困难补贴年限（月）"
        width="110"
      >
        <template slot-scope="scope">
          {{
            scope.row.PovertySubsidyYears == 0
              ? "-"
              : scope.row.PovertySubsidyYears
          }}
        </template>
      </el-table-column>
      <el-table-column
        prop="CompanyPaymentYears"
        label="职工养老缴费年限（月）"
        width="110"
      >
        <template slot-scope="scope">
          {{
            scope.row.CompanyPaymentYears == 0
              ? "-"
              : scope.row.CompanyPaymentYears
          }}
        </template></el-table-column
      >
      <el-table-column
        prop="FinalSubsidyYears"
        label="享受补贴年限（年）"
        width="93"
      >
        <template slot-scope="scope">
          {{
            scope.row.FinalSubsidyYears == 0
              ? "-"
              : yearjs(scope.row.FinalSubsidyYears)
          }}
        </template>
      </el-table-column>
      <el-table-column
        prop="SubsidyMoney"
        label="补贴金额"
        width="150"
        style="text-align: right"
      >
        <template slot-scope="scope">
          {{ number_format(scope.row.SubsidyMoney, 2) }}
        </template>
      </el-table-column>
      <el-table-column
        prop="InterestMoney"
        label="计息金额"
        width="150"
        style="text-align: right"
      >
        <template slot-scope="scope">
          {{ number_format(scope.row.InterestMoney, 2) }}
        </template>
      </el-table-column>
      <!-- <el-table-column prop="BankName" label="开户行名称" width="180">
      </el-table-column>
      <el-table-column prop="BankAccount" label="银行账号" width="180">
      </el-table-column> -->
      <el-table-column prop="CreateTime" label="创建时间" width="160">
        <template slot-scope="scope">{{
          formatDate(scope.row.CreateTime)
        }}</template>
      </el-table-column>
      <!-- <el-table-column prop="Note" label="备注" width="180"></el-table-column> -->
    </el-table>
    <el-pagination
      v-show="showInfo"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[10, 50, 100, 200]"
      :page-size="pagesize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="this.tableData.length"
    >
    </el-pagination>
    <el-form
      :model="ruleForm"
      :inline="true"
      class="demo-form-inline third"
      v-show="showInfo"
      style="margin-top: 50px"
    >
      <el-form-item label="人数:" label-width="101px">
        <el-input
          v-model="ruleForm.prople"
          placeholder="展示内容"
          disabled
        ></el-input>
      </el-form-item>
      <el-form-item label="补贴金额:" label-width="101px">
        <el-input
          v-model="ruleForm.zbtje"
          placeholder="展示内容"
          disabled
        ></el-input>
      </el-form-item>
      <el-form-item label="计息金额：">
        <el-input
          placeholder=""
          v-model="jiximoney"
          :disabled="true"
          style="text-align: right; align: right"
        >
        </el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import yearjs from "../../utils/yearjs";
import { API_GET_LAND, API_GET_BYID } from "../../api/table";
import {
  API_RE_VIEW,
  API_RETURN_VIEW,
  API_GETTV,
  API_VIEW_ALL,
  API_RETURN_ALL,
} from "../../api/userbusiness";
export default {
  name: "",
  data() {
    return {
      msg: "人员信息审核",
      showInfo: false,
      /* 分页 */
      pagesize: 10, //每页的数据条数
      currentPage: 1,
      options: [], // 征地项目
      value: "",
      val: "",
      formInline: {
        user: "",
        region: "",
      },
      openchange: false,
      input: "",
      labelPosition: "right",
      tableData: [],
      tableList: [],
      multipleSelection: [], // 选中数据合集
      currentPage4: 1,
      ruleForm: {
        village: "", // 村
      },
      jiximoney: "", // 计息金额总额展示
    };
  },
  created() {
    this.submitArea();
  },
  methods: {
    yearjs(num) {
      if ((num % 12 != 0) & (num > 12)) {
        return parseInt(num / 12) + "年" + (num % 12) + "月";
      } else if (num < 12) {
        return num + "月";
      } else {
        return parseInt(num / 12);
      }
    },
    // 全选所有
    allCheckEvent() {
      if (this.allCheck) {
        this.testList.forEach((row) => {
          this.$refs.recordTable.toggleRowSelection(row, true);
        });
      } else {
        this.$refs.recordTable.clearSelection();
      }
    },
    // 单条数据通过审核
    modify(row) {
      this.$confirm("确认通过申请？")
        .then((_) => {
          // console.log(this.multipleSelection);
          // let data = this.multipleSelection.map((item) => {
          //   return {
          //     Id: item.Id,
          //     IdentityNum: item.IdentityNum,
          //   };
          // });
          if (row.ReviewResult != 1) {
            this.$message.error("数据异常，无法操作！");
          } else {
            let data = [
              { Id: row.Id, IdentityNum: row.IdentityNum, LandId: row.LandId },
            ];
            // console.log(data);
            API_RE_VIEW(data)
              .then((res) => {
                console.log(res);
                this.query();
                this.$message.success("通过成功！");
              })
              .catch((err) => {
                console.log(err);
              });
          }
        })
        .catch((_) => {
          console.log("aaa");
        });
    },
    // 单条数据退回审核
    mitRef(row) {
      this.$confirm("确认退回申请？")
        .then((_) => {
          // console.log(this.multipleSelection);
          // console.log(data);
          console.log(row.ReviewResult);
          if (row.ReviewResult != 1) {
            this.$message.error("数据异常，无法操作！");
          } else {
            let data = [
              { Id: row.Id, IdentityNum: row.IdentityNum, LandId: row.LandId },
            ];
            API_RETURN_VIEW(data)
              .then((res) => {
                console.log(res);
                this.$message.success("退回成功！");
                this.query();
              })
              .catch((err) => {
                console.log(err);
              });
          }
        })
        .catch((_) => {
          console.log("aaa");
        });
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    onSubmit() {
      if (this.value != "") {
        this.showInfo = true;
        let data = {
          Landid: this.value,
          Review: 1,
        };
        API_GETTV(data)
          .then((res) => {
            this.tableData = res.ResList;
            this.ruleForm.prople = this.tableData.length;
            console.log(res);
            let a = 0,
              b = 0;
            this.tableData.map((item, index) => {
              // console.log(Number(item.SubsidyMoney));
              a += Number(this.tableData[index].SubsidyMoney);
              b += Number(this.tableData[index].InterestMoney);
            });
            this.ruleForm.zbtje = this.number_format(a, 2);
            this.jiximoney = this.number_format(b, 2);
            this.$message.success("查询成功！");
          })
          .catch((err) => {
            console.log(err);
          });
      } else {
        this.$message.warning("未识别到项目");
      }
    },
    query() {
      if (this.value != "") {
        this.showInfo = true;
        let data = {
          Landid: this.value,
          Review: 1,
        };
        API_GETTV(data)
          .then((res) => {
            this.tableData = res.ResList;
            this.ruleForm.prople = this.tableData.length;
            console.log(res);
            let a = 0,
              b = 0;
            this.tableData.map((item, index) => {
              // console.log(Number(item.SubsidyMoney));
              a += Number(this.tableData[index].SubsidyMoney);
              b += Number(this.tableData[index].InterestMoney);
            });
            this.ruleForm.zbtje = this.number_format(a, 2);
            this.jiximoney = this.number_format(b, 2);

            this.$message.success("数据刷新成功！");
          })
          .catch((err) => {
            console.log(err);
          });
      } else {
        this.$message.warning("未识别到项目");
      }
    },
    onChange() {
      this.openchange = !this.openchange;
    },
    /* 分页 */
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.pagesize = val;
    },
    handleCurrentChange(currentPage) {
      // console.log(`当前页: ${val}`);
      this.currentPage = currentPage;
    },
    /* 导出文档 */
    exportClick() {
      this.export2Excel();
    },
    export2Excel() {
      require.ensure([], () => {
        const { export_json_to_excel } = require("../../vendor/Export2Excel");

        const tHeader = [
          "序号",
          "姓名",
          "性别",
          "身份证号",
          "年龄",
          "基准补贴年限",
          "享受困难补贴年限",
          "职工养老缴费年限",
          "实际补贴年限",
          "实际补贴金额",
        ];

        const filterVal = [
          "number",
          "village",
          "landname",
          "years",
          "batch",
          "massif",
          "approvaldate",
          "interestdate",
          "yearwages",
          "wages",
          "measureland",
          "areaprice",
          "levytaxes",
          "socialsecurity",
          "households",
          "people",
        ];

        const list = [
          {
            number: 1,
            village: "1村",
            landname: "第一项目",
            years: "2020",
            batch: "122",
            massif: "852",
            approvaldate: "2020-01-03",
            interestdate: "2020-02-05",
            yearwages: "2018",
            wages: "564454",
            measureland: "565",
            areaprice: "455",
            levytaxes: "4:5",
            socialsecurity: "541",
            households: "1568",
            people: "4515",
          },
        ];

        const data = this.formatJson(filterVal, this.tableData);

        export_json_to_excel(tHeader, data, "**人员信息审核" + new Date());
      });
    },
    formatJson(filterVal, jsonData) {
      return jsonData.map((v) => filterVal.map((j) => v[j]));
    },
    printText() {
      this.$router.push("/projectinfo/print");
    },
    /* 获取征地项目列表 */
    submitArea() {
      API_GET_LAND()
        .then((res) => {
          this.options = res.ResList;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    overChange() {
      // console.log(this.value);
      if (this.value != this.val) {
        // this.condition = false;
        let data = {
          lid: this.value,
        };
        // console.log(data);
        API_GET_BYID(data)
          .then((res) => {
            console.log(res);
            this.val = this.value;
            this.tableList = res.ResList;
            // this.ruleForm.village = res.ResList[0].Village;
            // this.ruleForm.landName = res.ResList[0].ProjectName;
            // this.ruleForm.years = res.ResList[0].YearNum;
            // this.ruleForm.pic = res.ResList[0].BatchNum; // 批次
            // this.ruleForm.land = res.ResList[0].BlockNum; // 地块
            // this.ruleForm.pDate = this.formatDate(res.ResList[0].ApprovedDate);
            // this.ruleForm.landMj = res.ResList[0].ApprovedArea;
            // this.ruleForm.price = res.ResList[0].RegionPrice; // 片区价
            // this.ruleForm.zjbli = res.ResList[0].LevyScale; // 征缴比例
            // this.ruleForm.shbxf = res.ResList[0].SecurityAmount; // 社会保险费
            // this.ruleForm.zbtje = res.ResList[0]; // 补贴金额
            this.ruleForm.prople = this.tableData.length; // 人数
            // this.ruleForm.btrsh = this.tableData.length; // 补贴人数
            // this.ruleForm.zhdmj = res.ResList[0].LandAreaOriginal; // 征地项目
          })
          .catch((err) => {
            console.log(err);
          });
      }
    },
    /* 时间戳格式化 */
    formatDate(time) {
      if (time != "") {
        if (time.toString().substr(6, 13) < 0) {
          return "";
        } else {
          return this.timeD(new Date(parseInt(time.toString().substr(6, 13))));
        }
      }
    },
    timeD(date) {
      var y = date.getFullYear();
      var m = date.getMonth() + 1;
      m = m < 10 ? "0" + m : m;
      var d = date.getDate();
      d = d < 10 ? "0" + d : d;
      var h = date.getHours();
      h = h < 10 ? "0" + h : h;
      var minute = date.getMinutes();
      minute = minute < 10 ? "0" + minute : minute;
      var second = date.getSeconds();
      second = second < 10 ? "0" + second : second;
      return y + "-" + m + "-" + d + " " + h + ":" + minute + ":" + second;
    },
    formDate(time) {
      if (time.ApprovedDate != "") {
        return new Date(
          parseInt(time.ApprovedDate.toString().substr(6, 13))
        ).toLocaleDateString();
      }
    },
    submitId() {
      this.openchange = !this.openchange;
      // console.log(this.value);
      this.val = this.value;
      let data = {
        lid: this.val,
      };
      API_GET_BYID(data)
        .then((res) => {
          console.log(res);
          this.tableList = res.ResList;
          // this.ruleForm.village = res.ResList[0].Village;
          // this.ruleForm.landName = res.ResList[0].ProjectName;
          // this.ruleForm.years = res.ResList[0].YearNum;
          // this.ruleForm.pic = res.ResList[0].BatchNum; // 批次
          // this.ruleForm.land = res.ResList[0].BlockNum; // 地块
          // this.ruleForm.pDate = this.formatDate(res.ResList[0].ApprovedDate);
          // this.ruleForm.landMj = res.ResList[0].ApprovedArea;
          // this.ruleForm.price = res.ResList[0].RegionPrice; // 片区价
          // this.ruleForm.zjbli = res.ResList[0].LevyScale; // 征缴比例
          // this.ruleForm.shbxf = res.ResList[0].SecurityAmount; // 社会保险费
          // this.ruleForm.zbtje = res.ResList[0]; // 补贴金额
          this.ruleForm.prople = this.tableData.length; // 人数
          // this.ruleForm.btrsh = this.tableData.length; // 补贴人数
          // this.ruleForm.btrsh = res.ResList[0]; // 补贴人数
          this.ruleForm.zhdmj = res.ResList[0].LandAreaOriginal; // 征地项目
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 通过申请
    adopt() {
      this.$confirm("确认通过申请？")
        .then((_) => {
          // console.log(this.multipleSelection);
          let data = this.multipleSelection.map((item) => {
            return {
              Id: item.Id,
              IdentityNum: item.IdentityNum,
              LandId: item.LandId,
            };
          });
          // console.log(data);
          if (data.length != 0) {
            API_RE_VIEW(data)
              .then((res) => {
                console.log(res);
                this.query();
                this.$message.success("通过成功！");
              })
              .catch((err) => {
                console.log(err);
              });
          } else {
            this.$message.error("This is a error !");
          }
        })
        .catch((_) => {
          console.log("aaa");
        });
    },
    adoptAll() {
      this.$confirm("确认通过所有申请？")
        .then((_) => {
          let data = { Landid: this.value };
          API_VIEW_ALL(data)
            .then((res) => {
              console.log(res);
              this.$message.success("通过成功！");
              this.query();
            })
            .catch((err) => {
              console.log(err);
            });
        })
        .catch((_) => {
          // this.$message.warning("通过失败！");
        });
    },
    // 退回申请
    reject() {
      this.$confirm("确认退回申请？")
        .then((_) => {
          // console.log(this.multipleSelection);
          let data = this.multipleSelection.map((item) => {
            return {
              Id: item.Id,
              IdentityNum: item.IdentityNum,
            };
          });
          // console.log(data);
          if (data.length != 0) {
            API_RETURN_VIEW(data)
              .then((res) => {
                console.log(res);
                this.$message.success("退回成功！");
                this.query();
              })
              .catch((err) => {
                console.log(err);
              });
          } else {
            this.$message.warning("未识别到数据 !");
          }
        })
        .catch((_) => {
          console.log("aaa");
        });
    },
    // 全部退回
    rejectAll() {
      this.$confirm("确认退回所有申请？")
        .then((_) => {
          let data = { Landid: this.value };
          API_RETURN_ALL(data)
            .then((res) => {
              console.log(res);
              this.$message.success("退回成功！");
              this.query();
            })
            .catch((err) => {
              console.log(err);
            });
        })
        .catch((_) => {});
    },

    // 数据合计
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 14) {
          const values = data.map((item) => Number(item[column.property]));
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
              const value = Number(curr);
              if (!isNaN(value)) {
                return prev + curr;
              } else {
                return prev;
              }
            }, 0);
            sums[14] += " 元";
          } else {
            sums[14] = "--";
          }
        } else if (index === 5) {
          sums[index] = this.tableData.length + "人";
        }
      });
      return sums;
    },
    number_format(number, decimals, dec_point, thousands_sep) {
      /*
       * 参数说明：
       * number：要格式化的数字
       * decimals：保留几位小数
       * dec_point：小数点符号
       * thousands_sep：千分位符号
       *
       */
      number = (number + "").replace(/[^0-9+-Ee.]/g, "");
      var n = !isFinite(+number) ? 0 : +number,
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = typeof thousands_sep === "undefined" ? "," : thousands_sep,
        dec = typeof dec_point === "undefined" ? "." : dec_point,
        s = "",
        toFixedFix = function (n, prec) {
          var k = Math.pow(10, prec);
          return "" + parseInt(n * k) / k;
        };
      s = (prec ? toFixedFix(n, prec) : "" + parseInt(n)).split(".");
      var re = /(-?\d+)(\d{3})/;
      while (re.test(s[0])) {
        s[0] = s[0].replace(re, "$1" + sep + "$2");
      }
      if ((s[1] || "").length < prec) {
        s[1] = s[1] || "";
        s[1] += new Array(prec - s[1].length + 1).join("0");
      }
      return s.join(dec);
    },
  },
};
</script>

<style scoped lang="scss">
.userbusiness {
  padding: 30px;
  .el-form {
    .el-form-item__label {
      width: 73px;
    }
  }
  // .el-table {
  //   margin-bottom: 20px;
  //   height: calc(100vh - 345px);
  // }
  .second {
    max-width: 1483px;
    min-width: 1185px;
  }
  .third {
    min-width: 1185px;
  }
  .el-pagination {
    // max-width: 1601px;
    width: 100%;
    margin-top: 10px;
    text-align: right;
  }

  ::v-deep .el-table__body .el-table_1_column_14 {
    text-align: right !important;
  }

  ::v-deep .el-input.is-disabled .el-input__inner {
    text-align: right;
  }
}
</style>
